﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="Majesty_of_Omega.GUI.RegionItemDetailPart"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480" 
	xmlns:Majesty_of_Omega_GUI_Controls="clr-namespace:Majesty_of_Omega.GUI.Controls" 
    xmlns:Generator="clr-namespace:Majesty_of_Omega.Logic.Generator;assembly=Majesty_of_Omega_BL"
    xmlns:Majesty_of_Omega_BL_GalaxyModel="clr-namespace:Majesty_of_Omega.Model.Space;assembly=Majesty_of_Omega_BL">
	<UserControl.Resources>
		<Style x:Key="InfoTextStyle" TargetType="{x:Type TextBlock}">
			<Setter Property="TextWrapping" Value="NoWrap"/>
			<Setter Property="TextTrimming" Value="None"/>
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="HorizontalAlignment" Value="Left" />
			<Setter Property="Margin" Value="4,0,4,0"  />
		</Style>
        <ObjectDataProvider x:Key="TestDataGeneratorDS" ObjectType="{x:Type Generator:TestDataGenerator}" />
	</UserControl.Resources>

	<Majesty_of_Omega_GUI_Controls:SetupPanelControl Width="Auto" Height="Auto" Header="{Binding Path=TestRegion.RegionName, Mode=Default, Source={StaticResource TestDataGeneratorDS}}" Location="Right">
		<StackPanel Width="Auto" Height="Auto">
			<Grid DataContext="{Binding Path=TestRegion, Source={StaticResource TestDataGeneratorDS}}" >
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="40"/>
					<ColumnDefinition Width="20"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="60"/>
					<ColumnDefinition Width="20"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="24" />
					<RowDefinition Height="24" />
				</Grid.RowDefinitions>

				<!-- Race Info -->
				<Image Source="..\..\..\Graphics\Species\Kla.png"  Grid.Row="0" x:Name="RaceImage" Grid.RowSpan="2" Margin="4,-8,4,0" Width="30" />
				<TextBlock Margin="0,0,0,0" VerticalAlignment="Bottom" Grid.Row="1" Text="Kla" FontSize="8" HorizontalAlignment="Center" />

				<!-- Icons -->
				<Image Source="..\..\..\Graphics\UI\ico_fertility00.png" Grid.Column="1" Stretch="Uniform" Width="20" Height="20" x:Name="FertilityIcon"  />
				<Image Source="..\..\..\Graphics\ui\ico_plnts_stable2.png" Grid.Row="1" Grid.Column="1" Stretch="None" Width="20" Height="20" />

				<!-- Context -->
				<TextBlock FontWeight="Bold" Text="Lush" Grid.Column="2"  x:Name="LushText" Style="{DynamicResource InfoTextStyle}"  />
				<TextBlock FontWeight="Bold" Text="Stable"  Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4,0,4,0" Style="{DynamicResource InfoTextStyle}" />

				<!-- Background-->
				<Border Grid.Column="3" Grid.RowSpan="2">
					<Image x:Name="BackgroundTerrainImage" Source="..\..\..\Graphics\PlanetStructure\MountainBackground.png" StretchDirection="Both" Stretch="UniformToFill" Width="Auto" Height="Auto"/>
				</Border>
			</Grid>
            <Path Width="Auto" Style="{DynamicResource DividerPathStyle}" Margin="0,4,0,4"/>
			<TreeView Width="Auto"
				ItemsSource="{Binding Path=TestRegion.DeaList, Mode=Default, Source={StaticResource TestDataGeneratorDS}}"
			>
			<TreeView.Resources>
					<DataTemplate x:Key="ImprovementTemplate">
						<StackPanel>
				           <TextBlock Text="{Binding Path=Name}"/>
						 </StackPanel>
			        </DataTemplate>
				</TreeView.Resources>
                <TreeView.ItemTemplate>
                    <HierarchicalDataTemplate 
							ItemsSource="{Binding Improvements}"
							ItemTemplate="{StaticResource ImprovementTemplate}" 
							>
                        <StackPanel>
                            <TextBlock Text="{Binding Path=Name}"/>
						 </StackPanel>
                    </HierarchicalDataTemplate>
                </TreeView.ItemTemplate>
			</TreeView>
		</StackPanel>
	</Majesty_of_Omega_GUI_Controls:SetupPanelControl>
</UserControl>
